<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

	<head>
		<title>[%$ESPCMS_SOFT_TITLE%]</title>
		<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
		<link href="[%$ESPCMS_ADMIN_TEMPLATES_URL%]css/espcms_style_font_icon.css" rel="stylesheet" type="text/css" />
		<link href="[%$ESPCMS_ADMIN_TEMPLATES_URL%]css/espcms_style_public.css" rel="stylesheet" type="text/css" />
		<link href="[%$ESPCMS_ADMIN_TEMPLATES_URL%]css/espcms_all.css" rel="stylesheet" type="text/css" />
		<link href="[%$ESPCMS_ADMIN_TEMPLATES_URL%]css/espcms_framework.css" rel="stylesheet" type="text/css" />
		<link href="[%$ESPCMS_ADMIN_TEMPLATES_URL%]css/espcms_select.css" rel="stylesheet" type="text/css" />
		<link href="[%$ESPCMS_ADMIN_TEMPLATES_URL%]css/pageload.css" rel="stylesheet" type="text/css" />
		<link href="[%$ESPCMS_ADMIN_TEMPLATES_URL%]css/file.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/jquery.min.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/jquery-ui.min.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/jquery.cookie.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_dialog.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/md5.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/json.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/bootstrap.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/lngpack_cn.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_form.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_formvalidation.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_dialog.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_function.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_tool.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_page.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_select.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_checkbox.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_select_checkbox.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_batch.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_tab.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/nprogress.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/iframeResizer.contentWindow.min.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_multiple.js"></script>
		<script type="text/javascript">
			var ADMIN_DIRNAME="[%$ESPCMS_ADMIN_DIRNAME%]";
			$(document).ready(function () {
				banpageKey();
				$("[placeholder]").tooltip();
				$('input[type=checkbox],input[type=radio]').espcms_checkbox();
				$("#espcms_saveInfo").espcms_formvalidation({
					focusName: "#templatename",
					verifyURL: "[%$link.verify%]",
					verifyField: "templatecode",
					dynamiQueryString: "typeclass",
					dynamitype: "select"
				});
				$('#espcms_saveInfo').ajaxForm({
					type: 'POST',
					url: '[%$link.save%]',
					dataType: 'json',
					beforeSubmit: function () {
						parent.espcms_are_loading();
					},
					success: function (data) {
						parent.$("#espcms_are_loading").dialog("close");
						parent.$("body").append(data.data);
						if (data.code === 'true') {
							save_ok(data);
						} else {
							var botton = [
								{
									text: "[%pack:botton_pack-espcms_botton_colse%]",
									class: "btn btn-lightgray",
									click: function () {
										parent.$(this).dialog("close");
										parent.$(this).espcms_window_tab('close', {'iframeName': '[%$iframes_name%]'});
									}
								}
							];
							parent.espcms_public_dialog(data.domid_name, botton, 600);
						}
						$(window).unbind('beforeunload');
					}
				});
				$('.espcms_save_cancel').espcms_window_tab('closeTab');
				load_tabclick('.tab_click');
				$('#label').on('change', function () {
					var label = $(this).val();
					$.ajax({
						type: "get", url: "[%$link.key%]", data: {'label': label}, global: false,
						beforeSend: function () {
							parent.espcms_are_loading();
						},
						success: function (data) {
							parent.$("#espcms_are_loading").dialog("close");
							$('.label_key').empty().append(data);

							$(".lable_key_click").unbind('click').bind('click', function () {
								var data_key = $(this).attr('data-key');
								var old_val = $('#templatecontent').val();
								var new_val = old_val + data_key;
								$('#templatecontent').val(new_val);
							});
						}
					});
				});
			});
			//添加成功后的样式表
			function save_ok(data) {
				parent.$.espcms_sticky(data.message, {'autoclose': 3000});
				parent.frames['[%$par_iframes_name%]'].add_loading('ajax_list');
				parent.window.frames['[%$iframes_name%]'].location.reload();
			}
		</script>
		<script type="text/javascript" src="[%ESPCMS_URL%]espcms_includes/ueditor/ueditor_config.js"></script>
		<script type="text/javascript" src="[%ESPCMS_URL%]espcms_includes/ueditor/ueditor.js"></script>
		<script type="text/javascript" src="[%ESPCMS_URL%]espcms_includes/ueditor/seapoa/seapoaaddpic.js"></script>
		<script type="text/javascript" src="[%ESPCMS_URL%]espcms_includes/ueditor/seapoa/seapoaaddvideo.js"></script>
		<script type="text/javascript" src="[%ESPCMS_URL%]espcms_includes/ueditor/seapoa/seapoaaddfilelink.js"></script>
	</head>

	<body class="espcms_style_all">
		<div class="main">
			<div class="espcms_center_content_list">
				<!--正文-->
				<div class="panel">
					<div class="panel-body form_bottom_page">
						<form class="form-horizontal admin-form" id="espcms_saveInfo" action="[%$link.save%]">
							<input type="hidden" name="token_key" id="token_key" value="[%$token.token_key%]"/>
							<input type="hidden" name="token_name" id="token_name" value="[%$token.token_name%]"/>
							<div class="section-divider mb40"><span>[%pack:templates_pack-espcms_templates_sms_button_add%]</span></div>
							<div class="form-group">
								<label class="col-sm-2 control-label">[%pack:templates_pack-espcms_templates_mail_templatename%]</label>
								<div class="col-sm-9">
									<input type="text" name="templatename" class="form-control" id="templatename" maxlength="80" data-validation-minlength="2" data-validation-maxlength="50" placeholder="[%pack:templates_pack-espcms_templates_mail_templatename_title%]" title="[%pack:templates_pack-espcms_templates_mail_templatename_title%]" data-validation-msg="[%pack:templates_pack-espcms_templates_mail_templatename_validation_msg%]"/>
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label">[%pack:templates_pack-espcms_templates_mail_templatecode%]</label>
								<div class="col-sm-9">
									<input type="text" name="templatecode" class="form-control" id="templatecode" data-validation="^[\w]+$" placeholder="[%pack:templates_pack-espcms_templates_mail_templatecode_title%]" title="[%pack:templates_pack-espcms_templates_mail_templatecode_title%]" data-validation-msg="[%pack:templates_pack-espcms_templates_mail_templatecode_validation_msg%]" validation-warning="[%pack:templates_pack-espcms_templates_mail_templatecode_warning_msg%]"/>
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label">[%pack:templates_pack-espcms_templates_mail_typeclass%]</label>
								<div class="col-sm-9">
									<select class="selectpicker form-control" name="typeclass" id="typeclass" data-size="8" title="[%pack:templates_pack-espcms_templates_mail_typeclass_title%]" data-validation="^[\w]+$" data-validation-msg="[%pack:templates_pack-espcms_templates_mail_typeclass_validation_msg%]">
										[%forlist from=$typeclass key=i%]
										<option value="[%$typeclass[i].key%]">[%$typeclass[i].name%]</option>
										[%/forlist%]
									</select>
								</div>
							</div>
							<div class="form-group issendtype1">
								<label class="col-sm-2 control-label">[%pack:templates_pack-espcms_templates_mail_label%]</label>
								<div class="col-sm-9">
									<select class="selectpicker form-control" name="label" id="label" data-size="8" title="[%pack:templates_pack-espcms_templates_mail_label_title%]">
										[%forlist from=$typeclass key=i%]
										<option value="[%$typeclass[i].key%]">[%$typeclass[i].name%]</option>
										[%/forlist%]
									</select>
								</div>
							</div>
							<div class="form-group issendtype1">
								<label class="col-sm-2 control-label"></label>
								<div class="col-sm-9"><span class="input_exp"> <span class="exp_icon espcms_icon_fa espcms_icon_fa-exclamation-circle" aria-hidden="true"></span>[%pack:templates_pack-espcms_templates_sms_label_str%]</span></div>
							</div>
							<div class="form-group issendtype1">
								<label class="col-sm-2 control-label"></label>
								<div class="col-sm-9">
									<ul class="label_key"></ul>
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label">[%pack:templates_pack-espcms_templates_sms_templatecontent%]</label>
								<div class="col-sm-9">
									<input type="text" name="templatecontent" class="form-control" id="templatecontent" maxlength="150" data-validation-minlength="2" data-validation-maxlength="150" placeholder="[%pack:templates_pack-espcms_templates_sms_templatecontent_title%]" title="[%pack:templates_pack-espcms_templates_sms_templatecontent_title%]" data-validation-msg="[%pack:templates_pack-espcms_templates_sms_templatecontent_validation_msg%]"/>
								</div>
							</div>

							<div class="form_button">
								<button type="submit" class="btn btn-green min-w-150" formmethod="POST">[%pack:botton_pack-espcms_botton_save_ok%]</button>
								<button type="button" class="btn btn-lightgray min-w-150 espcms_save_cancel">[%pack:botton_pack-espcms_botton_save_cancel%]</button>
							</div>
						</form>
					</div>
				</div>
				<!--正文_end-->
			</div>
		</div>
		[%link file="public/load.html"%]
		[%link file="public/load_height.html"%]
	</body>
</html>
